//
//  ReadCollectionViewCell.m
//  A_Project_DLS151129_SQ
//
//  Created by 151129-49宋强 on 16/1/20.
//  Copyright © 2016年 www.lanou3g.com蓝鸥. All rights reserved.
//

#import "ReadCollectionViewCell.h"

@implementation ReadCollectionViewCell

- (void)dealloc
{
    [_imgView release];
    [_nameLabel release];
    [super dealloc];
}
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.imgView = [[UIImageView alloc] init];
        //_imgView.backgroundColor = [UIColor yellowColor];
        [self.contentView addSubview:_imgView];
        [_imgView release];
        self.nameLabel = [[UILabel alloc] init];
        //  _nameLabel.backgroundColor = [UIColor redColor];
        [self.imgView addSubview:_nameLabel];
        _nameLabel.textColor = [UIColor whiteColor];
        [_nameLabel release];
    }
    return self;
}
//布局方法
- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes
{
    [super applyLayoutAttributes:layoutAttributes];
    _imgView.frame = CGRectMake(1, 1, layoutAttributes.size.width - 2, layoutAttributes.size.height - 10);
    CGRect h = _imgView.frame;
    _nameLabel.frame = CGRectMake(1, h.size.height - 20, h.size.width - 2, 15);
}

@end
